'''
Created on 21.11.2011

@author: mphkh
'''
from datetime import date
from TimeUtils.utils import *
from Calendar.Iceland import Iceland
from TimeUtils.daterolling import DateRollingConvention
from TimeUtils.daycount import *
from IRUtils import *

class REIBOR1M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = addmonth2(valuedate, 1, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360
        
class REIBOR2M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = addmonth2(valuedate, 2, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360

class REIBOR3M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = addmonth2(valuedate, 3, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360

class REIBOR6M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = addmonth2(valuedate, 6, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360

class REIBOR9M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = addmonth2(valuedate, 9, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360

class REIBOR12M(MoneyMarketRate):
    def __init__(self, valuedate, rate):
        self.valuedate = valuedate
        self.rate = rate
        cal = Iceland()
        daterollingconvention = DateRollingConvention.modifiedfollowing
        self.maturitydate = maturity1m = addmonth2(valuedate, 12, cal, daterollingconvention, 1)
        self.daycountbasis = DayCountBasis.basis_act360